﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IList<Prodma.DataAccess.Models.ViewModels.SepetVm>>" %>

<div class="listTitleContainer">Sepetim</div>
<div class="listTitleContainer2">
        <div class="listTitleCenter-50">#</div>
        <div class="listTitleCenter-100">Urun Adı</div>
        <div class="listTitleCenter-50">Miktar</div>
        <div class="listTitleCenter-100">Fiyat</div>
        <div class="listTitleCenter-100">KDV</div>
        <div class="listTitleCenter-100">Fiyat Toplam</div>
        <div class="listTitleCenter-100">KDV Toplam</div>
        <div class="listTitleCenter-100">Satır Toplam</div>
        
    </div>

    <div class="listRowContainer">
        <%decimal topFiyat = 0; %>
        <%decimal topKdv = 0; %>
        <% int counter = 1; %>
        <% foreach (Prodma.DataAccess.Models.ViewModels.SepetVm urunler in ViewData.Model) %>
        <% { %>
             <% if (counter % 2 != 0) %>
             <% { %>
                  <div class="listRow1">
                      <div class="listColumnCenter-50"><%=counter%></div>
                      <div class="listColumnCenter-100"><%=urunler.UrunID.UrunAdi%>
                        <input type="hidden" value="<%=urunler.UrunID.ID %>" name='SProduct<%=counter %>' id='SProduct<%=counter %>'/>
                      </div>
                      <div class="listColumnCenter-50">
                        <input type="text" onkeypress="handleKeyPress(event,<%=counter %>)" id='SText<%=counter %>' name='SText<%=counter %>' maxlength="2" value="<%=urunler.Miktar %>"
                              class="detailSectionControl" style="width: 25px"/>
                              <input type="hidden" id='SChart<%=counter %>' value="<%=urunler.ID %>" name='SChart<%=counter %>' /></div>
                      <% decimal fyt = urunler.UrunID.Fiyat ?? 0; %>
                      <% decimal kdv = (fyt * 18) / 100; %>
                      <% decimal Ufiyat = fyt * urunler.Miktar; %>
                      <% decimal Ukdv = kdv * urunler.Miktar; %>
                      <% topFiyat += Ufiyat; %>
                      <% topKdv += Ukdv; %>
                      <div class="listColumnCenter-100"><%=fyt%></div>
                      <div class="listColumnCenter-100"><%=kdv%></div>
                      <div class="listColumnCenter-100"><%=fyt*urunler.Miktar%></div>
                      <div class="listColumnCenter-100"><%=kdv*urunler.Miktar%></div>
                      <div class="listColumnCenter-100"><%=(fyt+kdv)*urunler.Miktar%></div>
                      <div class="listColumnCenter-50">
                        <a onclick="sil(<%=counter%>)" >
                            <img src="../../Images/ListImages/delete.png" alt="sepet"/>
                        </a>
                      </div>
                  </div>
             <% } %>
             <% else %>
             <% { %>
                  <div class="listRow1">
                      <div class="listColumnCenter-50"><%=counter%></div>
                      <div class="listColumnCenter-100"><%=urunler.UrunID.UrunAdi%>
                        <input type="hidden" value="<%=urunler.UrunID.ID %>" name='SProduct<%=counter %>' id='SProduct<%=counter %>'/>
                      </div>
                      <div class="listColumnCenter-50">
                        <input type="text" onkeypress="handleKeyPress(event,<%=counter %>)"  id='SText<%=counter %>' name='SText<%=counter %>' maxlength="2" value="<%=urunler.Miktar %>"
                              class="detailSectionControl" style="width: 25px"/>
                              <input type="hidden" id='SChart<%=counter %>' value="<%=urunler.ID %>" name='SChart<%=counter %>' /></div>
                      <% decimal fyt = urunler.UrunID.Fiyat ?? 0; %>
                      <% decimal kdv = (fyt * 18) / 100; %>
                      <% decimal Ufiyat = fyt * urunler.Miktar; %>
                      <% decimal Ukdv = kdv * urunler.Miktar; %>
                      <% topFiyat += Ufiyat; %>
                      <% topKdv += Ukdv; %>
                      <div class="listColumnCenter-100"><%=fyt%></div>
                      <div class="listColumnCenter-100"><%=kdv%></div>
                      <div class="listColumnCenter-100"><%=fyt*urunler.Miktar%></div>
                      <div class="listColumnCenter-100"><%=kdv*urunler.Miktar%></div>
                      <div class="listColumnCenter-100"><%=(fyt+kdv)*urunler.Miktar%></div>
                      <div class="listColumnCenter-50">
                        <a onclick="sil(<%=counter%>)" >
                            <img src="../../Images/ListImages/delete.png" alt="sepet"/>
                        </a>
                      </div>
                  </div>
             <% } %>
             <% counter++; %>
        <% } %>
        <div class="listRow1">
            <div class="listColumnCenter-50">&nbsp;</div>
            <div class="listColumnCenter-100">&nbsp;</div>
            <div class="listColumnCenter-50">&nbsp;</div>
            <div class="listColumnCenter-100">&nbsp;</div>
            <div class="listColumnCenter-100">TOPLAM</div>
            <div class="listColumnCenter-100"><%=topFiyat %></div>
            <div class="listColumnCenter-100"><%=topKdv %></div>
            <div class="listColumnCenter-100"><%=(topKdv+topFiyat) %></div>
            <div class="listColumnCenter-100">&nbsp;</div>
        </div>
        <div class="listFooterContainer">
        </div> 

    </div>
    <script type="text/javascript">
      
   </script>